package general.exceptions;

import general.datastructures.Vector2f;

public class NoRouteFoundException extends PointException {

	private static final long serialVersionUID = 2906948942310979124L;
	private final Vector2f to;
	
	/**
	 * Constructor which accepts a message
	 * @param message Messagestring
	 */
	public NoRouteFoundException(String message) {
		super(message);
		to = null;
	}

	/**
	 * Constructor which accepts a message and two {@link Vector2f}s
	 * 
	 * @param message Messagestring
	 * @param from Origin {@link Vector2f}
	 * @param to Destination {@link Vector2f}
	 */
	public NoRouteFoundException(String message, Vector2f from, Vector2f to) {
		super(message, from);
		this.to = to;
	}
	
	/**
	 * @return Returns the {@link Vector2f}s, followed by the Messagestring
	 */
	@Override
	public String getMessage() {
		return "Keine Route von " + super.p.toString() + " nach " + to.toString() +" gefunden\n"+super.getMessage();
	}
}
